<extend name="Common@Layout:layui-admin" />
<block name="title">
    <title>邮件模板设置</title>
</block>
<block name="style">
    <style>
        .layui-main {
            padding: 10px;
        }
        
        .layui-form {
            padding-top: 20px
        }
        
        .layui-form-label {
            width: 110px
        }
        
        .layui-input-block {
            margin-left: 140px;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
            width: 300px;
        }                                         
        
        .layui-tab-title li {
            font-size: 16px;
        }
    </style>
</block>

<block name="main">
    <div class="layui-main" style="width:auto">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">邮箱验证模板</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote">参数：#username#,#email#,#code#,#link#</blockquote>
                    <form class="layui-form" action="{:U('edit_post')}" method="post">
                        <input type="hidden" name="group" value="find_pwd_check">
                        <input type="hidden" name="options[tpl]" value="" id="find_pwd_check_tpl">
                        <div class="layui-form-item">
                            <label class="layui-form-label">邮件标题：</label>
                            <div class="layui-input-block">
                                <input type="text" name="options[title]" value="{:F('Options/option_find_pwd_check_title')}" placeholder="" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">邮件内容</label>
                            <div class="layui-input-block" style="width:650px;">
                                <div id="reg_check_editor">{:F('Options/option_find_pwd_check_tpl')}</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <a class="layui-btn" id="saveBtn" style="margin-left:30px;">保存</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</block>


<block name="script">
    <script type="text/javascript" src="/Public/weditor/wangEditor.min.js"></script>
    <script>
        var E = window.wangEditor;
        var editor = new E('#reg_check_editor');
        editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
        editor.create();
        layui.use(['jquery'], function() {
            var $ = layui.jquery;
            $('#saveBtn').click(function() {
                $('#find_pwd_check_tpl').val(editor.txt.html());
                layui.miniweb.formSubmit($('form'));
            });
        });
    </script>
</block>